@echo off
echo Starting IoT Communication Server (JAR version)...

REM Check if JAR file exists
if not exist "target\iotcomm-server-v0.91.jar" (
    echo Error: Server JAR file not found!
    echo Please run build-jars.bat first to package the application.
    echo.
    pause
    exit /b 1
)

REM Set JavaFX module path
set JAVAFX_MODULES=--module-path "C:\Users\%USERNAME%\.m2\repository\org\openjfx" --add-modules javafx.controls,javafx.fxml,javafx.base,javafx.graphics

REM Run server JAR
java %JAVAFX_MODULES% -jar target\iotcomm-server-v0.91.jar

echo.
echo Press any key to exit...
pause > nul